package com.qyhl.webtv.module_broke.scoop.mine;


import com.qyhl.webtv.commonlib.entity.circle.ScoopListBean;

import java.util.List;

/**
 * Created by qyhl on 2017/12/13.
 */

public class ScoopMinePresenter implements ScoopMineContract.ScoopMinePresenter {
    private ScoopMineContract.ScoopMineView mView;

    private ScoopMineModel mModel;

    public ScoopMinePresenter(ScoopMineContract.ScoopMineView mView) {
        this.mView = mView;
        this.mModel = new ScoopMineModel(this);
    }

    @Override
    public void getMine(String brokeId,String is) {
        mModel.getMine(brokeId,is);
    }

    @Override
    public void setData(List<ScoopListBean> beanList, boolean isMore) {
        mView.setData(beanList, isMore);
    }

    @Override
    public void setError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.showMessage(msg);
                break;
            case 2:
                mView.setEmpty(msg);
                break;
            case 3:
                mView.showLog(msg);
                break;
            case 4:
                mView.setError(msg);
                break;
            case 5:
                mView.showMessage(msg);
                break;
            default:break;
        }
    }
}
